package ch07.ex2_2_1_OrderingOperators

/**
 * Created by caozp-ytcyc2007 on 2017/6/1.
 */

class Person(val firstName: String, val lastName: String): Comparable<Person> {
    override fun compareTo(other: Person): Int {
        return compareValuesBy(this, other, Person::lastName, Person::firstName)
    }
}

fun main(args: Array<String>) {
    val p1 = Person("Alice", "Smith")
    val p2 = Person("Bob", "johnson")
    println(p1 < p2)
}